package com.kingyun.gpsinspection.purificationservice.services.iam.innerservice.accessory.impl;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.kingyun.gpsinspection.purificationservice.dao.mapper.iam.accessory.EntityTypePropertyVoMapper;
import com.kingyun.gpsinspection.purificationservice.facade.model.iam.accessory.EntityTypePropertyVo;
import com.kingyun.gpsinspection.purificationservice.facade.service.iam.accessory.IamEntityTypePropertyVoService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

/**
 * Created by ${yangsy} on 2017/3/18.
 */
public class IamEntityTypePropertyVoServiceImpl implements IamEntityTypePropertyVoService
{
    @Autowired
    private EntityTypePropertyVoMapper entityTypePropertyVoMapper;
    @Override
    public List<EntityTypePropertyVo> queryList(EntityTypePropertyVo entityTypePropertyVo) {
       return entityTypePropertyVoMapper.queryList(entityTypePropertyVo);
    }

    @Override
    public JSONObject jsonObject(EntityTypePropertyVo entityTypePropertyVo) {
        JSONObject jsonObject = new JSONObject();
        if(entityTypePropertyVo == null) {
            return jsonObject;
        }
        List<EntityTypePropertyVo> list = queryList(entityTypePropertyVo);
        if(list == null || list.size() < 0){
            return jsonObject;
        }
        jsonObject.put("rows", JSON.toJSON(list));
        return jsonObject;
    }

    @Override
    public List<EntityTypePropertyVo> queryList2(String devlistTempId) {
        return entityTypePropertyVoMapper.queryList2(devlistTempId);
    }

    @Override
    public List<EntityTypePropertyVo> queryList3(Map<String,String> map) {
        return entityTypePropertyVoMapper.queryList3(map);
    }
}
